package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.Unit;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import javax.websocket.server.PathParam;
import java.util.List;
import java.util.Map;

/**
 * @description 商品信息
 */
public interface GoodsDao {


    String getMaxCode();

    Integer getCountTotal(@Param("codeOrName") String codeOrName,
                          @Param("goodsTypeIds") Object[] goodsTypeIds);

    List<Goods> getGoodsPageInfoBy(@Param("page") Integer page,
                                   @Param("rows") Integer rows,
                                   @Param("codeOrName") String codeOrName,
                                   @Param("goodsTypeIds") Object[] goodsTypeId);


    List<Unit> getUnitList();

    void saveGoods(@Param("goods") Goods goods);


    void updateGoods(@Param("goods") Goods goods,
                     @Param("goodsId") Integer goodsId);

    void deleteGoodsByGoodsId(@Param("goodsId") Integer goodsId);

    Integer getNoInventoryQuantityCountTotal(@Param("nameOrCode") String nameOrCode);

    List<Goods> getGoodsPageInfoByNoInventoryQuantity(@Param("page") Integer page,
                                                      @Param("rows") Integer rows,
                                                      @Param("nameOrCode") String nameOrCode);

    Integer getHasInventoryQuantityCountTotal(@Param("nameOrCode") String nameOrCode);

    List<Goods> getGoodsPageInfoByHasInventoryQuantity(@Param("page") Integer page,
                                                    @Param("rows") Integer rows,
                                                    @Param("nameOrCode") String nameOrCode);

    void updateInventoryQuantityByGoodsId(@Param("goodsId") Integer goodsId,
                                          @Param("inventoryQuantity") Integer inventoryQuantity,
                                          @Param("purchasingPrice") double purchasingPrice);

    Integer getStateByGoodsId(@Param("goodsId") Integer goodsId);

    void deleteInventoryQuantityByGoodsId(@Param("goodsId") Integer goodsId);

    List<Goods> getListAlarm();

}
